<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        *{padding: 0;margin: 0;}
        #wrap{
            padding: 8px;
        }
        button{
            margin-bottom: 10px;
        }
        li{
            list-style: none;
            line-height: 45px;
            border: 1px solid #333;
            text-indent: 10px;
        }
        li+li{
            border-top:0;
        }
    </style>
</head>
<body>
    <div id="wrap">
        <button class="btn">克隆</button>
        <ul class="list one" title="">
            <li id="first1">01</li>
            <li class="second">02</li>
            <li>03</li>
            <li name="last">04</li>
        </ul>
    </div>
</body>
<script>
    var btn = document.getElementsByClassName("btn")[0];
    var wrap = document.getElementById("wrap");
    var one = document.getElementsByClassName("one")[0];
    var second = document.getElementsByClassName("second")[0];

    // 节点的克隆
    // Element.cloneNode(bool)
    // Element.cloneNode(false)  默认false 只克隆当前元素及其相关属性 => 但是并不克隆子内容 
    // Element.cloneNode(true)   既克隆当前元素及其相关属性 又克隆子内容 

 
    btn.onclick = function(){
        var cloneUl = one.cloneNode(true);
        console.log(cloneUl);

        wrap.appendChild(cloneUl);
    }


</script>
</html>